<include file="public@header"/>
</head>
<body>
	<div class="wrap">
		<ul class="nav nav-tabs">
			<li><a href="{:url('index')}">菜品列表</a></li>
			<li class="active"><a>编辑菜品</a></li>
		</ul>
		<form method="post" class="form-horizontal js-ajax-form margin-top-20" action="{:url('editPost')}">
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">菜品名称<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-name" name="name" value="{$info.name}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-author" class="col-sm-2 control-label">作者<span class="form-required">*</span></label>
				<div class="col-md-6 col-sm-10">
					<input type="text" class="form-control" id="input-author" name="author" value="{$info.author}">
				</div>
			</div>
			<div class="form-group">
				<label for="input-name" class="col-sm-2 control-label">展示图</label>
				<div class="col-md-6 col-sm-10">
					<input type="hidden" name="thumbnail" id="thumb" value="{$info.thumbnail|default=''}">
					<a href="javascript:uploadOneImage('图片上传','#thumb');">
						<if condition="empty($info['thumbnail'])">
							<img src="__TMPL__/public/assets/images/default-thumbnail.png"
								 id="thumb-preview" width="135" style="cursor: hand"/>
							<else/>
							<img src="{:cmf_get_image_preview_url($info['thumbnail'])}" id="thumb-preview"
								 width="135" style="cursor: hand"/>
						</if>
					</a>
					<input type="button" class="btn btn-sm"
						   onclick="$('#thumb-preview').attr('src','__TMPL__/public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;"
						   value="取消图片">
				</div>
			</div>
			<div class="form-group">
				<div class="col-sm-offset-2 col-sm-10">
					<input type="hidden" name="id" value="{$info.id}">
					<button type="submit" class="btn btn-primary js-ajax-submit">{:lang('SAVE')}</button>
					<a class="btn btn-default" href="{:url('index')}">{:lang('BACK')}</a>
				</div>
			</div>
		</form>
	</div>
	<script src="__STATIC__/js/admin.js"></script>
</body>
</html>